home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / LANG / GNUST / !GNUst / st / ProcSched < prev    next >
Text File  |  1991-09-13  |  2KB  |  101 lines

  1. "======================================================================
  2. |
  3. |   ProcessorScheduler Method Definitions
  4. |
  5.  ======================================================================"
  6.  
  7.  
  8. "======================================================================
  9. |
  10. | Copyright (C) 1990, 1991 Free Software Foundation, Inc.
  11. | Written by Steve Byrne.
  12. |
  13. | This file is part of GNU Smalltalk.
  14. |
  15. | GNU Smalltalk is free software; you can redistribute it and/or modify it
  16. | under the terms of the GNU General Public License as published by the Free
  17. | Software Foundation; either version 1, or (at your option) any later version.
  18. | GNU Smalltalk is distributed in the hope that it will be useful, but WITHOUT
  19. | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  20. | FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
  21. | details.
  22. | You should have received a copy of the GNU General Public License along with
  23. | GNU Smalltalk; see the file COPYING.  If not, write to the Free Software
  24. | Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  
  25. |
  26.  ======================================================================"
  27.  
  28.  
  29. "
  30. |     Change Log
  31. | ============================================================================
  32. | Author       Date       Change 
  33. | sbyrne     25 Apr 89      created.
  34. |
  35. "
  36.  
  37. Object subclass: #ProcessorScheduler
  38.        instanceVariableNames: 'processLists activeProcess'
  39.        classVariableNames: ''
  40.        poolDictionaries: ''
  41.        category: nil.
  42.  
  43. ProcessorScheduler comment: 
  44. 'I provide methods that control the execution of processes.' !
  45.  
  46. !ProcessorScheduler methodsFor: 'basic'!
  47.  
  48. activeProcess
  49.     ^activeProcess
  50. !
  51.  
  52. terminateActive
  53.     activeProcess terminate
  54.     "Poor man's terminate"
  55. "    [true] whileTrue: [ Processor yield ]"
  56. !
  57.  
  58. yield
  59.     | process priority processList |
  60.     priority _ activeProcess priority.
  61.     processList _ processLists at: priority.
  62.     processList isEmpty
  63.         ifFalse: [ processList addLast: activeProcess.
  64.                    activeProcess suspend ]
  65. !
  66.  
  67. activePriority
  68.     ^self activeProcess priority
  69. !
  70.  
  71. timingPriority
  72.     8
  73. !
  74.  
  75. highIOPriority
  76.     7
  77. !
  78.  
  79. lowIOPriority
  80.     6
  81. !
  82.  
  83. userInterruptPriority
  84.     5
  85. !
  86.  
  87. userSchedulingPriority
  88.     4
  89. !
  90.  
  91. userBackgroundPriority
  92.     3
  93. !
  94.  
  95. systemBackgroundPriority
  96.     2
  97.  
  98. !!
  99.